<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
	<script>
		function add1(a, b) {
			b = b || 1;
			return a + b;
		}
		console.log(add1(10));

		function add2(a, b = 1) {
			return a + b;
		}
		console.log(add2(10))

		function fun(...values) {
			console.log(values.length);
		}
		fun(1, 2, 3);
		fun(1, 2, 3, 4, 5);
	</script>
</body>
</html>